<!--
 * @Descripttion: 
 * @version: 
 * @Author: albus
 * @Date: 2021-11-08 14:07:54
-->

<template>
  <div class="user pb-1">
    <div class="user-top">
      <img src="@/assets/user/user_bg.png" width="100%" alt="" />
      <svg-icon iconClass="remind" class="remind" />
      <div class="user-name">
        <div class="name">Halo</div>
        <div class="user-tip">Selamat Datang di Kredito</div>
      </div>
    </div>
    <div class="user-main">
      <div class="main-tab">
        <div v-for="item in tab" :key="item.title" class="main-tab-item">
          <svg-icon :iconClass="item.icon" class="tab-icon" />
          {{ item.title }}
        </div>
      </div>
      <div class="main-money">
        <div>
          <div>Batas pinjaman (Rp)</div>
          <span>1.000.000</span>
        </div>
        <div>
          <div>Total Pinjaman (Rp)</div>
          <span>5.000.000</span>
        </div>
      </div>
      <div v-for="(item, index) in mainList" :key="item.icon" class="main-list">
        <div
          class="main-item flex items-center"
          :class="index == mainList.length - 1 ? 'no-broder' : ''"
        >
          <svg-icon :iconClass="item.icon" class="icon-list" />
          <span>{{ item.title }}</span>
          <svg-icon iconClass="next" class="icon-next" />
        </div>
      </div>
      <div class="main-setting flex items-center mt-0.5">
        <svg-icon iconClass="setting" class="icon-list" />
        <span>Pengaturan</span>
        <svg-icon iconClass="next" class="icon-next" />
      </div>
      <div class="user-bottom my-10">
        <img src="@/assets/user/afpi.png" alt="" />
      </div>
    </div>
    <TabBar name="userCenter" />
  </div>
</template>

<script>
import TabBar from '../../components/TabBar/index.vue'
export default {
  name: 'UserCenter',
  props: {},
  data() {
    return {
      tab: [
        { title: 'Riwayyat', icon: 'wallet' },
        { title: 'Rek bank', icon: 'bank' },
        { title: 'Kupon', icon: 'ticket' }
      ],
      mainList: [
        { title: 'Meminjam pakai', icon: 'safety' },
        { title: 'Referral Code Saya', icon: 'share' },
        { title: 'Pusat bantuan', icon: 'bulb' },
        { title: 'Layanan Pelanggan Resmi', icon: 'service' },
        { title: 'Feedback', icon: 'message' },
        { title: 'Tentang Kami', icon: 'smile' }
      ]
    }
  },
  created() {},
  mounted() {},
  methods: {},
  components: { TabBar }
}
</script>

<style lang="less" scoped>
.user {
  font-size: 12px;
  background: #f5f5f5;
  min-height: 100vh;
  .user-top {
    position: relative;
    .remind {
      position: absolute;
      top: 18px;
      right: 18px;
      font-size: 18px;
    }
    .user-name {
      position: absolute;
      left: 20px;
      top: 52px;
      color: white;
      .name {
        font-size: 34px;
        font-weight: 600;
        line-height: 40px;
        margin-bottom: 4px;
      }
      .user-tip {
        font-size: 16px;
        line-height: 19px;
      }
    }
  }
  .user-main {
    position: relative;
    margin: -40px 18px 0;
    .main-tab {
      height: 86px;
      background: white;
      border-radius: 4px;
      display: flex;
      justify-content: space-around;
      align-items: center;
      margin-bottom: 12px;
      .main-tab-item {
        font-size: 14px;
        text-align: center;
        .tab-icon {
          font-size: 30px;
          width: 100%;
        }
      }
    }
    .main-money {
      height: 86px;
      background: white;
      border-radius: 4px;
      display: flex;
      justify-content: space-around;
      align-items: center;
      line-height: 22px;
      text-align: center;
      margin-bottom: 13px;
      div {
        color: #999;
        font-size: 12px;
        margin-bottom: 5px;
      }
      span {
        font-size: 22px;
        color: #000;
      }
    }
    .main-list {
      font-size: 14px;
      background: white;
      border-radius: 4px;
      padding: 0 20px;
      position: relative;
      .main-item {
        height: 56px;
        border-bottom: 1px solid #eee;
      }
      .no-broder {
        @apply border-none;
      }
    }
    .main-setting {
      font-size: 14px;
      background: white;
      border-radius: 4px;
      height: 56px;
      position: relative;
      padding: 0 20px;
    }
    .icon-list {
      margin-right: 12px;
    }
    .icon-next {
      position: absolute;
      right: 18px;
    }
  }

  .user-bottom {
    img {
      width: calc(100% - 114px);
      margin-left: 39px;
    }
  }
}
</style>
